package cn.edu.scau.cmi.guihao.client;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import spring.cn.edu.scau.cmi.guihao.domin.Student;
import spring.cn.edu.scau.cmi.guihao.domin.Teacher;

public class SpringClient {

	public static void main(String[] args) {
		String springXmlPath = "spring\\cn\\edu\\scau\\cmi\\guihao\\spring\\applicationContext.xml";
		ApplicationContext applicationContext = new ClassPathXmlApplicationContext(springXmlPath);
		Student student = (Student) applicationContext.getBean("201627020116");
		Teacher teacher = student.getTutor();
		System.out.println(student.getName());
		System.out.println(teacher.getName());
	}
	
}
